<?php
function duo(){

    return new class{
        public $color="red";
        public $height="162cm";
    };
}
var_dump(duo());
